package com.edocbase.desktop.plugins.mdiary;

import com.edocbase.desktop.lightweight.widgets.RibbonButton;
import com.edocbase.desktop.lightweight.widgets.SplitButton;

public class ButtonComposite {
	SplitButton button = null;
	RibbonButton ribbonButton = null;
	String id = null;
	public ButtonComposite(String id, SplitButton button) {
		super();
		this.id = id;
		this.button = button;
	}
	public ButtonComposite(String id, RibbonButton ribbonButton) {
		super();
		this.id = id;
		this.ribbonButton = ribbonButton;
	}
	public void setEnabled(boolean enabled){
		if (button != null){
			button.setEnabled(enabled);
		}
		if (ribbonButton != null){
			ribbonButton.setEnabled(enabled);
		}
	}
	public void setVisible(boolean b) {
		if (button != null){
			button.setVisible(b);
		}
		if (ribbonButton != null){
			ribbonButton.setVisible(b);
		}
	}
	public void setText(String text){
		if (button != null){
			button.setText(text);
		}
		if (ribbonButton != null){
			ribbonButton.setText(text);
		}
	}
}
